package cn.com.ddapp.ddm.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import cn.com.ddapp.ddm.R;
import cn.com.ddapp.ddm.util.TDevice;


public class NumsAdapter1 extends BaseAdapter {

	private Context mContext;
	//------------------------
	private List<String> mList;

	//------------------------
	public NumsAdapter1(Context mContext, List<String> mList) {
		this.mContext = mContext;
		this.mList = mList;
	}

	@Override
	public int getCount() {
		return mList.size();
	}

	@Override
	public Object getItem(int position) {
		return mList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		if (convertView == null) {
			convertView = LayoutInflater.from(mContext).inflate(
					R.layout.type_select_spanner_item, parent, false);

		}
		TextView tv = (TextView) convertView.findViewById(R.id.type_tv);
		//-----------------------
		tv.setText(mList.get(position));

		if(TDevice.isTablet(mContext)){
			tv.setTextSize(25.0f);
		}
		return convertView;
	}

}
